﻿namespace PErsonMimi
{
    using System.Collections.Generic;
    using System.Xml.Serialization;
    using System.Xml;
    [XmlRoot]
    public class Person
    {
        public Person() : this(0, new List<Contact>(), new List<Address>())
        { 
        }
        public Person(int curid)
            : this(curid, new List<Contact>(), new List<Address>())
        {
        }
        public Person(int curid, List<Address> adr)
            : this(curid, new List<Contact>(), adr)
        {
        }
        public Person(int curid, List<Contact> ct, List<Address> adr)
        {
            this.Contacts = ct;
            this.Addresses = adr;
           this.Contacts.Add(new Contact() { Value = "TestValue", ContactType = "TestType" });
           this.Addresses.Add(new Address() { City = "TestCity", Country = "TestCountry", Street = "TestStreet" });
           this.Id = curid;
            
        }
        [XmlElement]  
        public int Id{get; private set;}
        [XmlElement(typeof(List<Contact>))]
        public List<Contact> Contacts { get; private set; }
        [XmlElement(typeof(List<Address>))]
        public List<Address> Addresses { get; private set; }
    }
}
